<?php

namespace lib\Server\Service;

use lib\Server\Heartbeat\Manager;
use lib\Server\Heartbeat\Rpc;

class HeartbeatService
{
	static $mode;
	static $server;
	static $config;

	public function __construct($server ,$config)
	{
		self::$mode   = $config['mode'];
		self::$server = $server;
		self::$config = $config;

		$this->sendHertbeat();
	}

	public function sendHertbeat()
	{
		switch (self::$mode) {
			case 'manager':
				new Manager(self::$server,self::$config);
				break;
			case 'rpc':
				new Rpc(self::$server,self::$config);
				break;
			case 'register':
				break;
		}
	}
}